﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:Debugger.AddIn.Tooltips"
	xmlns:core="http://icsharpcode.net/sharpdevelop/core"
>
	<LinearGradientBrush x:Key="OrangeBrushKey" EndPoint="0,1" StartPoint="0,0">
		<LinearGradientBrush.GradientStops>
			<GradientStop Offset="0" Color="White" />
			<GradientStop Offset="0.5" Color="Orange" />
			<GradientStop Offset="1" Color="Orange" />
		</LinearGradientBrush.GradientStops>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="OrangePressedBrushKey" EndPoint="0,1" StartPoint="0,0">
		<LinearGradientBrush.GradientStops>
			<GradientStop Offset="1" Color="White" />
			<GradientStop Offset="0.5" Color="Orange" />
			<GradientStop Offset="0" Color="Orange" />
		</LinearGradientBrush.GradientStops>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="SilverBrushKey" EndPoint="0,1" StartPoint="0,0">
		<LinearGradientBrush.GradientStops>
			<GradientStop Offset="0" Color="White" />
			<GradientStop Offset="0.5" Color="LightGray" />
			<GradientStop Offset="1" Color="LightGray" />
		</LinearGradientBrush.GradientStops>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="SilverPressedBrushKey" EndPoint="0,1" StartPoint="0,0">
		<LinearGradientBrush.GradientStops>
			<GradientStop Offset="1" Color="White" />
			<GradientStop Offset="0.5" Color="LightGray" />
			<GradientStop Offset="0" Color="LightGray" />
		</LinearGradientBrush.GradientStops>
	</LinearGradientBrush>
	
	<ControlTemplate x:Key="CloseButtonTemplate" TargetType="Button">
		<Border Width="16" Height="16" Name="TheBorder" CornerRadius="2,2,0,0" BorderThickness="1" BorderBrush="Black" Background="{StaticResource SilverPressedBrushKey}">
			<Canvas>
				<Line X1="3.5" X2="10.5" Y1="3.5" Y2="10.5" Stroke="Black" StrokeThickness="2"/>
				<Line X1="3.5" X2="10.5" Y1="10.5" Y2="3.5" Stroke="Black" StrokeThickness="2"/>
			</Canvas>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="UIElement.IsMouseOver" Value="true">
				<Setter TargetName="TheBorder" Property="Background" Value="{StaticResource OrangeBrushKey}"/>
				<Setter TargetName="TheBorder" Property="BorderBrush" Value="Silver"/>
			</Trigger>
			<Trigger Property="ButtonBase.IsPressed" Value="True">
				<Setter TargetName="TheBorder" Property="Background" Value="{StaticResource OrangePressedBrushKey}"/>
				<Setter TargetName="TheBorder" Property="BorderBrush" Value="Silver"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
	<TransformGroup x:Key="Rotate">
		<RotateTransform Angle="270" CenterX="7" CenterY="7"/>
	</TransformGroup>
	
	<TransformGroup x:Key="RotateUnpin">
		<RotateTransform Angle="270" CenterX="7" CenterY="7"/>
		<RotateTransform Angle="-90" CenterX="7" CenterY="7"/>
		<ScaleTransform ScaleY="-1" CenterX="7" CenterY="7"/>
	</TransformGroup>
	
	<TransformGroup x:Key="RotatePin">
		<RotateTransform Angle="-90" CenterX="7" CenterY="7"/>
	</TransformGroup>
	
	<TransformGroup x:Key="FlipComment">
		<ScaleTransform CenterX="7" CenterY="7" ScaleY="-1"/>
	</TransformGroup>
	
	<ControlTemplate x:Key="PinButtonTemplate" TargetType="ToggleButton">
		<Border Width="16" Height="16" Name="TheBorder" CornerRadius="0" BorderThickness="1" BorderBrush="Black" Background="{StaticResource SilverPressedBrushKey}">
			<Canvas Name="TheCanvas">
				<Line X1="4" X2="10" Y1="2" Y2="2" Stroke="Black" StrokeThickness="1"/>
				<Line X1="9" X2="9" Y1="2" Y2="8" Stroke="Black" StrokeThickness="1"/>
				<Line X1="2" X2="12" Y1="8" Y2="8" Stroke="Black" StrokeThickness="1"/>
				<Rectangle Fill="Black" Width="2" Height="5" Canvas.Left="4" Canvas.Top="3"/>
				<Line X1="7" X2="7" Y1="9" Y2="12" Stroke="Black" StrokeThickness="1"/>
			</Canvas>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="UIElement.IsMouseOver" Value="true">
				<Setter TargetName="TheBorder" Property="Background" Value="{StaticResource OrangeBrushKey}"/>
				<Setter TargetName="TheBorder" Property="BorderBrush" Value="Silver"/>
			</Trigger>
			<Trigger Property="ButtonBase.IsPressed" Value="True">
				<Setter TargetName="TheCanvas" Property="RenderTransform" Value="{StaticResource RotatePin}"/>
				<Setter TargetName="TheBorder" Property="Background" Value="{StaticResource OrangePressedBrushKey}"/>
				<Setter TargetName="TheBorder" Property="BorderBrush" Value="Silver"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter TargetName="TheCanvas" Property="RenderTransform" Value="{StaticResource RotatePin}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
	<ControlTemplate x:Key="CommentButtonTemplate" TargetType="ToggleButton">
		<Border Width="16" Height="16" Name="TheBorder" CornerRadius="0,0,2,2" BorderThickness="1" BorderBrush="Black" Background="{StaticResource SilverPressedBrushKey}">
			<Canvas Name="TheCanvas">
				<Line X1="3" Y1="3" X2="7" Y2="7.5" Stroke="Black" StrokeThickness="1"/>
				<Line X1="7" Y1="7.4" X2="11" Y2="3" Stroke="Black" StrokeThickness="1"/>
				<Line X1="3" Y1="7.5" X2="7" Y2="12" Stroke="Black" StrokeThickness="1"/>
				<Line X1="7" Y1="12" X2="11" Y2="7.5" Stroke="Black" StrokeThickness="1"/>
			</Canvas>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="UIElement.IsMouseOver" Value="true">
				<Setter TargetName="TheBorder" Property="Background" Value="{StaticResource OrangeBrushKey}"/>
				<Setter TargetName="TheBorder" Property="BorderBrush" Value="Silver"/>
			</Trigger>
			<Trigger Property="ButtonBase.IsPressed" Value="True">
				<Setter TargetName="TheBorder" Property="Background" Value="{StaticResource OrangePressedBrushKey}"/>
				<Setter TargetName="TheBorder" Property="BorderBrush" Value="Silver"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="True">
				<Setter TargetName="TheCanvas" Property="RenderTransform" Value="{StaticResource FlipComment}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
	<SolidColorBrush x:Key="MouseOverPinBrush" Color="Black" />
	
	<ControlTemplate x:Key="PinTooltipButtonTemplate" TargetType="ToggleButton">
		<Border Width="16" Height="16" Name="TheBorder" CornerRadius="2" BorderBrush="Transparent" BorderThickness="1" Background="Transparent">
			<Canvas RenderTransform="{StaticResource Rotate}" Name="TheCanvas">
				<Line X1="4" X2="10" Y1="2" Y2="2" Stroke="Silver" StrokeThickness="1" Name="Line1"/>
				<Line X1="9" X2="9" Y1="2" Y2="8" Stroke="Silver" StrokeThickness="1" Name="Line2"/>
				<Line X1="2" X2="12" Y1="8" Y2="8" Stroke="Silver" StrokeThickness="1" Name="Line3"/>
				<Rectangle Fill="Silver" Width="2" Height="7" Canvas.Left="4" Canvas.Top="2" Name="Rectangle"/>
				<Line X1="7" X2="7" Y1="9" Y2="12" Stroke="Silver" StrokeThickness="1" Name="Line4"/>
			</Canvas>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="ButtonBase.IsPressed" Value="True">
				<Setter TargetName="TheCanvas" Property="RenderTransform" Value="{StaticResource RotateUnpin}"/>
			</Trigger>
			<Trigger Property="ButtonBase.IsMouseOver" Value="True">
				<Setter TargetName="Line1" Property="Stroke" Value="{StaticResource MouseOverPinBrush}"/>
				<Setter TargetName="Line2" Property="Stroke" Value="{StaticResource MouseOverPinBrush}"/>
				<Setter TargetName="Line3" Property="Stroke" Value="{StaticResource MouseOverPinBrush}"/>
				<Setter TargetName="Line4" Property="Stroke" Value="{StaticResource MouseOverPinBrush}"/>
				<Setter TargetName="Rectangle" Property="Fill" Value="{StaticResource MouseOverPinBrush}"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="True">
				<Setter TargetName="TheCanvas" Property="RenderTransform" Value="{StaticResource RotateUnpin}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
	<Style
		TargetType="{x:Type TextBox}"
		x:Key="TextStyle">
		<Setter
			Property="OverridesDefaultStyle"
			Value="True" />
		<Setter
			Property="VerticalAlignment"
			Value="Center" />
		<Setter
			Property="FontFamily" Value="Khmer UI" />
		<Setter Property="FontSize" Value="12" />
		<Setter
			Property="KeyboardNavigation.TabNavigation"
			Value="None" />
		<Setter
			Property="FocusVisualStyle"
			Value="{x:Null}" />
		<Setter
			Property="Template">
			<Setter.Value>
				<ControlTemplate
					TargetType="{x:Type TextBoxBase}">
					<Border
						Name="Border"
						Background="Transparent"
						BorderBrush="Transparent"
						BorderThickness="0">
						<ScrollViewer
							Margin="0"
							Name="PART_ContentHost" />
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style TargetType="TextBlock" x:Key="TextBlockStyle">
		<Setter Property="Margin" Value="4 0" />
		<Setter
			Property="FontFamily" Value="Khmer UI" />
		<Setter Property="FontSize" Value="12" />
	</Style>
	
	<Style x:Key="PinThumbStyle" TargetType="Thumb">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Thumb">
					<StackPanel x:Name="Container"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style
		x:Key="ExpandCollapseToggleStyle"
		TargetType="{x:Type ToggleButton}">
		<Setter
			Property="Focusable"
			Value="False" />
		<Setter
			Property="Width"
			Value="19" />
		<Setter
			Property="Height"
			Value="13" />
		<Setter
			Property="Template">
			<Setter.Value>
				<ControlTemplate
					TargetType="{x:Type ToggleButton}">
					<Border
						Width="19"
						Height="13"
						Background="Transparent">
						<Border
							Width="9"
							Height="9"
							BorderThickness="1"
							BorderBrush="#FF7898B5"
							CornerRadius="1"
							SnapsToDevicePixels="true">
							<Border.Background>
								<LinearGradientBrush
									StartPoint="0,0"
									EndPoint="1,1">
									<LinearGradientBrush.GradientStops>
										<GradientStop
											Color="White"
											Offset=".2" />
										<GradientStop
											Color="#FFC0B7A6"
											Offset="1" />
									</LinearGradientBrush.GradientStops>
								</LinearGradientBrush>
							</Border.Background>
							<Path
								x:Name="ExpandPath"
								Margin="1,1,1,1"
								Fill="Black"
								Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z" />
						</Border>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger
							Property="IsChecked"
							Value="True">
							<Setter
								Property="Data"
								TargetName="ExpandPath"
								Value="M 0 2 L 0 3 L 5 3 L 5 2 Z" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style
		x:Key="upDownBorderStyle"
		TargetType="{x:Type Border}">
		<Setter
			Property="BorderBrush"
			Value="Gray" />
		<Setter
			Property="HorizontalAlignment"
			Value="Stretch" />
		<Setter
			Property="Margin"
			Value="0" />
		<Setter
			Property="Padding"
			Value="0" />
		<Setter
			Property="Background"
			Value="#FFECF7FC" />
		<Setter
			Property="Height"
			Value="14" />
		<Style.Triggers>
			<DataTrigger
				Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}"
				Value="False">
				<Setter
					Property="Background"
					Value="#FFE0E0E0"></Setter>
			</DataTrigger>
		</Style.Triggers>
	</Style>
	<Style
		x:Key="upButtonStyle"
		TargetType="{x:Type RepeatButton}">
		<Setter
			Property="Template">
			<Setter.Value>
				<ControlTemplate
					TargetType="{x:Type RepeatButton}">
					<Border
						Style="{StaticResource upDownBorderStyle}"
						BorderThickness="1 1 1 0">
						<ContentPresenter
							HorizontalAlignment="Center"></ContentPresenter>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style
		x:Key="downButtonStyle"
		TargetType="{x:Type RepeatButton}">
		<Setter
			Property="Template">
			<Setter.Value>
				<ControlTemplate
					TargetType="{x:Type RepeatButton}">
					<Border
						Style="{StaticResource upDownBorderStyle}"
						BorderThickness="1 0 1 1">
						<ContentPresenter
							HorizontalAlignment="Center"></ContentPresenter>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<ControlTemplate x:Key="RefreshButton" TargetType="Button">
		<Border
			Name="ImageBorder"
			CornerRadius="7"
			BorderBrush="Transparent"
			BorderThickness="1"
			Height="14"
			Width="14">
			<Image Width="9" Height="9" Margin="2 2"
			       x:Name="RefreshContentImage"
			       Tag="{Binding}"
			       Source="{core:GetBitmap Icons.16x16.Refresh}"/>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="UIElement.IsMouseOver" Value="true">
				<Setter TargetName="ImageBorder" Property="Background" Value="{StaticResource SilverBrushKey}"/>
				<Setter TargetName="ImageBorder" Property="BorderBrush" Value="Gray"/>
			</Trigger>
			<Trigger Property="ButtonBase.IsPressed" Value="True">
				<Setter TargetName="ImageBorder" Property="Background" Value="{StaticResource SilverPressedBrushKey}"/>
				<Setter TargetName="ImageBorder" Property="BorderBrush" Value="Gray"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
</ResourceDictionary>